package com.itqf.service.impl;

import com.itqf.dao.UserDao;
import com.itqf.service.UserService;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/11/9
 * @Time: 上午9:50
 */
public class UserServiceImpl implements UserService {

    public  UserServiceImpl(){
        System.out.println("spring创建UserServiceImpl对象......");
    }

    //依赖dao层
    //private UserDao userDao = new UserDaoImpl();//强耦合

    private UserDao userDao = null;//解耦

    public void setUserDao(UserDao userDao) {
        System.out.println("spring调用setter方法赋值.......setUserDao");
        this.userDao = userDao;
    }

    @Override
    public void insert() {
        userDao.insert();
    }

    @Override
    public void update() {
        userDao.update();
    }
}
